home *** CD-ROM | disk | FTP | other *** search
/ The World's Largest Collection of Windows Software / The World's Largest Collection of Windows Software - Disc 2.iso / textproc / _j2 / collec / keys.bas < prev    next >
BASIC Source File  |  1993-06-28  |  1KB  |  48 lines

  1. DEFINT A-Z
  2. DECLARE SUB ParseAndWrite (ffFile$, ffTitle$, ffKeyWord$)
  3. '**********************************
  4. 'This program reads in the .CSV file created by the Collector macro in
  5. 'WinWord, and parses out the keywords.
  6.  
  7. DIM ffFile$, ffTitle$, KeyTitle$, HelpID$, Browse$, ffKeyWord$, Comments$, BuildTag$, EntryMacro$
  8. DIM done
  9.  
  10. ON ERROR GOTO OUTTAHERE
  11. OPEN "tracker.csv" FOR INPUT AS #1
  12. OPEN "keys.csv" FOR OUTPUT AS #2
  13.  
  14. DO
  15.         INPUT #1, ffFile$, ffTitle$, KeyTitle$, HelpID$, Browse$, ffKeyWord$, Comments$, BuildTag$, EntryMacro$
  16.     ParseAndWrite ffFile$, ffTitle$, ffKeyWord$
  17. LOOP WHILE NOT EOF(1)
  18. SYSTEM
  19.  
  20. OUTTAHERE:
  21. PRINT "Error "; ERR; " - "; ERROR$
  22. CLOSE #1
  23. CLOSE #2
  24. SYSTEM
  25.  
  26. '****************************************
  27. SUB ParseAndWrite (ffFile$, ffTitle$, ffKeyWord$)
  28.  
  29. s = 0: temp$ = "": KeyLength = LEN(ffKeyWord$)
  30. WHILE s < KeyLength
  31.     k$ = MID$(ffKeyWord$, s + 1, 1)
  32.     IF k$ = ";" THEN
  33.         WRITE #2, temp$, ffTitle$, ffFile$
  34.         temp$ = ""
  35.         s = s + 1
  36.     ELSE
  37.         temp$ = temp$ + k$
  38.         s = s + 1
  39.     END IF
  40. WEND
  41.  
  42. IF temp$ <> "" THEN
  43.     WRITE #2, temp$, ffTitle$, ffFile$
  44. END IF
  45.  
  46. END SUB
  47.  
  48.